﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyUtils
{
	partial class Utils
	{
		static readonly WeakKeyCache<object, DynamicDictionaryObject> _attachedDynamicContainer = new WeakKeyCache<object, DynamicDictionaryObject>();

		public static dynamic Attached(this object item)
		{
			return _attachedDynamicContainer[item, () => new DynamicDictionaryObject(item.AttachedDictionary())];
		}
	}
}
